package com.cyt.base.model.dto;

import com.cyt.base.util.ErrorCode;

/**
 *@Author: YuShengQiang
 *@Date: 2018-11-16 11:29
 *@Description: json返回实体类
 */
public class ReturnResult {
    private int code;//返回状态，0表示成功，其他表示失败
    private Object data;//成功时，返回的参数
    private String msg;//信息
    private long count;
    private boolean hasNextPage;//是否有下一页

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public ReturnResult(int code, Object data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public ReturnResult(Object data) {
        this.code = ErrorCode.CODE_0;
        this.msg= ErrorCode.CODE_0_MSG;
        this.data = data;
    }

    public ReturnResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ReturnResult() {
        this.code = ErrorCode.CODE_0;
        this.msg= ErrorCode.CODE_0_MSG;
        this.data= ErrorCode.CODE_0_MSG;
    }

    public ReturnResult(Object data, long count) {
        this.code = ErrorCode.CODE_0;
        this.msg= ErrorCode.CODE_0_MSG;
        this.data = data;
        this.count = count;
    }

    public ReturnResult(Object data, long count, boolean hasNextPage) {
        this.code = ErrorCode.CODE_0;
        this.msg= ErrorCode.CODE_0_MSG;
        this.data = data;
        this.count = count;
        this.hasNextPage = hasNextPage;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public boolean isHasNextPage() {
        return hasNextPage;
    }

    public void setHasNextPage(boolean hasNextPage) {
        this.hasNextPage = hasNextPage;
    }
}
